﻿@{
    ViewBag.Title = "采购价格列表";
    Layout = "~/Views/Shared/_LayoutList.cshtml"; 
}
@(       
 Html.DWZGridFor<Resto.CostControl.Core.MaterialPrice>()
        .Title("采购价格列表")
    .Action(@Url.Action("Index"))
    .Columns(col =>
    {
        col.Bind(e => e.Id).IsKey();
        col.Bind(e => e.SupplierId).EnumKey("Supplier").Align(FlexiGridAlign.Left).Width(140);
        col.Bind(e => e.MaterialName).Align(FlexiGridAlign.Left).Width(100).AsQuery();
        col.Bind(e => e.Price).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.PrePrice).Width(50).Align(FlexiGridAlign.Right);
        col.Bind(e => e.IsValid).Width(50).EnumKey("DataState").Align(FlexiGridAlign.Center);
        col.Bind(e => e.StartDate).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.EndDate).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.UpdateUser).Width(60);
        col.Bind(e => e.UpdateDate).Width(70).DateFormat("yyyy-MM-dd");
        col.Bind(e => e.Id, "操作", 120).Sortable(false)
            .Template(Url.EditLinkTwo(Url.Action("Edit"), "编辑采购价格")
            + Url.DeleteLink("Delete", "${MaterialName}"));
    })
    .Buttons(btn =>
    {
        btn.Bind("Add", "新建采购价格", FlexiGridButtonType.Add).Action(@Url.Action("Edit")).OnPress("AddNewTwo");
    })
)
